#ifndef _H_HMC5883L
#define _H_HMC5883L
#include <stdint.h>

#define HMC5883L_OK               1
#define HMC5883L_ERROR            0
 
 
#define bsp_DelayMS               HAL_Delay
#define HMC5883L_SLAVE_ADDRESS    0x3C           /* I2C???? */
 
#define DATA_OUT_X        0x03
 
typedef struct
{
    int16_t X;
    int16_t Y;
    int16_t Z;
 
    int16_t X_Min;
    int16_t Y_Min;
    int16_t Z_Min;
 
    int16_t X_Max;
    int16_t Y_Max;
    int16_t Z_Max;
 
    uint8_t Status;
    
    uint8_t CfgRegA;
    uint8_t CfgRegB;
    uint8_t CfgRegC;
    uint8_t ModeReg;
    
    uint8_t IDReg[3+1];
}HMC5883L_T;
 
extern HMC5883L_T g_tMag;
void hmc5883l_Init(void);
void hmc5883l_ReadData(void);

#endif